package sample.jdbc.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import sample.jdbc.service.ITestService;
import sample.jdbc.vo.TestVo;

import java.util.List;

@RestController
public class TestController {

    private static final Logger LOGGER = LoggerFactory.getLogger(TestController.class);

    @Autowired
    private ITestService testService;

    @GetMapping("/test")
    public String test(){
        List<TestVo> list = testService.findAll();
        LOGGER.info("---success diaoyong test!!---");
        LOGGER.error("---success diaoyong test!!---");
        return "sample-jdbc test successful! list size ="+(list==null?0:list.size());
    }
}
